
package com.shop.cloud.mall.admin.controller;

import com.shop.cloud.common.core.util.R;
import com.shop.cloud.common.data.shardingdatabase.config.ShardingDataBaseProperties;
import com.shop.cloud.common.security.annotation.Inside;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;


/**
 * 分库管理
 *
 * @author 
 * @date 2023-03-22 17:01:21
 */
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/shardingdatabase")
@Tag(description = "shardingdatabase", name = "分库管理")
public class ShardingDataBaseController {

    private final ShardingDataBaseProperties shardingDataBaseProperties;

    /**
     * 获取分库名（服务间调用）
     * @return
     */
    @Operation(summary = "获取分库名（服务间调用）")
    @GetMapping("/properties/dbname")
    @Inside
    public R getShardingDataBasePropertiesDbname() {
        return R.ok(shardingDataBaseProperties.getDbname());
    }
}
